def AND(x1, x2):
    w1, w2, theta = 0.5, 0.5, 0.7
    tmp = x1*w1 + x2*w2
    if tmp < theta:
        return 0
    elif tmp > theta:
        return 1

# 测试用例
test_results = {
    (0, 0): AND(0, 0),
    (1, 0): AND(1, 0),
    (0, 1): AND(0, 1),
    (1, 1): AND(1, 1)
}

#print(test_results)
for key, value in test_results.items():
    print(f"{key}: {value}")
